﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Net;
using System.Net.Http;
using System.Text;
using System.Threading.Tasks;
using System.Web.Http;
using nwrole.SuperModule.service.Models;

namespace nwrole.SuperModule.service.Controllers
{
    public class PulseController : ApiController
    {
        public HttpResponseMessage PostPulse(PulseDto pulseDto)
        {
            if (!ModelState.IsValid)
                return Request.CreateErrorResponse(HttpStatusCode.BadRequest, ModelState);

            SuperModule.Pulse(pulseDto.ServiceName, pulseDto.Message);

            HttpResponseMessage response = Request.CreateResponse(HttpStatusCode.Created, pulseDto);
            //response.Headers.Location = new Uri(Url.Link("DefaultApi", new { id = taskDto.TaskId }));
            return response;
        }
    }
}
